//
//  StudentModel.m
//  ArchitectDemo
//
//  Created by 姚胜龙 on 2017/6/13.
//  Copyright © 2017年 姚胜龙. All rights reserved.
//

#import "StudentModel.h"

@implementation StudentModel

- (instancetype)initWithName:(NSString *)name
                    teachers:(NSArray<TeacherModel *> *)teachers
{
    self = [super init];
    if (self) {
        self.stuName = name;
        self.teachers = teachers;
    }
    return self;
}

- (id)copyWithZone:(NSZone *)zone {
    NSMutableArray<TeacherModel *> *newArray = [NSMutableArray array];
    for (TeacherModel *teacher in self.teachers) {
        [newArray addObject:teacher.copy];
    }
    return [[StudentModel alloc] initWithName:self.stuName teachers:newArray];
}

@end
